#!/bin/bash 
HADOOP_DIR=/naver/pos/hadoop/hadoop-moda/
 date1=$1 
 date2=$2 
  
#verify dates 
 if ! date -d "$date1" 2>&1 > /dev/null ;  
 then echo "first date is invalid" ; exit 1 
 fi 
 if ! date -d "$date2" 2>&1 > /dev/null ;  
 then echo "second date is invalid" ; exit 1 
 fi 

#set current and end date 
 current=$(date -d "$date1" +%Y-%m-%d)
 end=$(date -d "$date2" +%Y-%m-%d)

function body_func()
{
	echo "body_func] current: $1"
}

echo "from $current to $end"
while [ "$end" != "$current" ]  
do 
body_func $current
current=$(date -d "$current +1day" +%Y-%m-%d) 
done 
